package com.tuanzi.loan.web.lazy.statistics;

import com.tuanzi.loan.vo.response.statistics.SmsStatisticsResponse;
import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.service.statistics.SmsStatisticsService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.statistics.SmsStatisticsRequest;

public class SmsStatisticsLazyDataModel extends BaseLazyDataModel<SmsStatisticsRequest, SmsStatisticsResponse> {

	private SmsStatisticsService smsStatisticsService = SpringContextHolder.getBean(SmsStatisticsService.class);
	private PageSearcher<SmsStatisticsRequest> pageSearcher = null;

	public SmsStatisticsLazyDataModel(SmsStatisticsRequest searchRequest) {
		super(searchRequest);
	}

	@Override
	protected Page<SmsStatisticsResponse> doLoad(PageSearcher<SmsStatisticsRequest> pageSearcher) {
		this.pageSearcher = pageSearcher;
		return smsStatisticsService.list(pageSearcher);
	}

	public PageSearcher<SmsStatisticsRequest> getPageSearcher() {
		return pageSearcher;
	}
}
